<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
//运行代码
function runEx(cod1)  {
	 cod=document.getElementById(cod1)
	  var code=cod.value;
	  if (code!=""){
		  var newwin=window.open('','','');  
		  newwin.opener = null 
		  newwin.document.write(code);  
		  newwin.document.close();
	}
}
//复制代码
function doCopy(ID) { 
	if (document.all){
		 textRange = document.getElementById(ID).createTextRange(); 
		 textRange.execCommand("Copy"); 
	}
	else{
		 //alert("此功能只能在IE上有效");
		 copyToClipboard(document.getElementById(ID).value);
	}
}
//另存为代码
function saveCode(cod1) {
	cod=document.getElementById(cod1)
	var code=cod.value;
	if (code!=""){
        var winname = window.open('', '_blank', 'top=10000');
        winname.document.open('text/html', 'replace');
        winname.document.write(code);
        winname.document.execCommand('saveas','','code.htm');
        winname.close();
	}
}

</script>
</head>

<body>

<div>
<textarea class="UBBText" id="CodeText73376" rows="8"></textarea>
<br />
<input onclick="runEx('CodeText73376')" type="button" value="运行代码"/>
<input onclick="doCopy('CodeText73376')" type="button" value="复制代码"/>
<input onclick="saveCode('CodeText73376')" type="button" value="另存代码"/>
</div>	
</body>
</html>
